3 It is now possible to measure temperatures with the help of the I²C LM75 and 1-Wire DS18B20 chips. The temperature values can be displayed on the OSD and they are also logged. A total maximum of 8 temperature sensors can be connected. The support is enabled by default on F4 and F7 FCs. To use with F3 FCs you need to build a custom firmware.
7 Up to 8 can be connected to the flight controller.
9 * Package: SOP-8, breakout boards can be found easily
10 * Interface: I²C (**max 400kHz**)
12 * Temperature range: -55 to +125°C
14 On the purple LM75 (CJMCU-75), address line pins on the bottom of the PCB need to be bridged either to ground or VCC (to define I2C address)
16 ![image](assets/images/CJMCU-75_address.png)
19 | A2 | A1 | A0 |Address|INAV add|
20 |-----|-----|-----|-------|--------|
21 | GND | GND | GND | 0x48 | 0 |
22 | GND | GND | VCC | 0x49 | 1 |
23 | GND | VCC | GND | 0x4A | 2 |
24 | GND | VCC | VCC | 0x4B | 3 |
25 | VCC | GND | GND | 0x4C | 4 |
26 | VCC | GND | VCC | 0x4D | 5 |
27 | VCC | VCC | GND | 0x4E | 6 |
28 | VCC | VCC | VCC | 0x4F | 7 |
30 If more than one sensor is used, each sensor must have different address.
35 * Package: TO-92, SO-8, µSOP-8
37 * Supply: 3.0 to 5.5V (parasitic power not supported)
38 * Temperature range: -55 to +125°C
40 None of the flight controllers on the market at the time this documentation is written supports 1-Wire directly. To use these sensors a I²C to 1-Wire interface chip needs to be used, the DS2482. Connect the DS2482 SCL and SDA lines to your FC, add a 4.7kohm pull-up resistor between VCC and the DQ pin then connect all the sensors DQ pin to the DS2482 DQ pin.
42 ## Configuring temperature sensors
44 The `temp_sensor` CLI command can be used to display and change the temperature sensors configuration. When a new temperature sensor is connected it is automatically detected and will appear in the output of the `temp_sensor` command.
46 * `temp_sensor` without any argument displays all the sensors configuration
47 * `temp_sensor reset` deletes all the sensors
48 * `temp_sensor index type address alarm_min alarm_max osd_symbol label` to configure a new sensor or modify the configuration of an existing one.
50 ### Parameters description
52 * `index` is the index of the configuration slot you want to change
53 * `type` can be `1` for LM75 or `2` for DS18B20
54 * `address` is the address of the device on the bus. 0 to 7 for a LM75 or the full 64bit ROM in hex format for a 18B20
55 * `alarm_min` is the temperature under which the corresponding OSD element will start blinking (decidegrees centigrade)
56 * `alarm_max` is the temperature above which the corresponding OSD element will start blinking (decidegrees centigrade)
57 * `osd_symbol` is the ID of a symbol to display on the OSD to the left of the temperature value. Use 0 to display a label instead (see next parameter). See the table bellow for the available IDs
58 * `label` is a 4 characters maximum label that is displayed on the OSD next to the temperature value
60 | Symbol ID | Description |
61 |-----------|-----------------------------|
62 | 1 | Generic temperature symbol |
63 | 2 | ESC temperature symbol |
64 | 3 | VTX temperature symbol |
65 | 4 | Motor temperature symbol |
66 | 5 | Battery temperature symbol |
67 | 6 | Exterior temperature symbol |
71 Example output of the `temp_sensor` command on a system with two LM75 and four DS18B20 sensors connected
74 temp_sensor 0 1 0 -200 600 0
75 temp_sensor 1 1 1 -200 600 0
76 temp_sensor 2 2 7c0118681e1cff28 -200 600 0
77 temp_sensor 3 2 7d01186838f2ff28 -200 600 0
78 temp_sensor 4 2 210118684001ff28 -200 600 0
79 temp_sensor 5 2 f801186750c7ff28 -200 600 0
84 To set for example the OSD symbol of the first temperature sensor to the ESC symbol:
86 `temp_sensor 0 1 0 -200 600 2`
88 To change for example the configuration of the fourth sensor to label `BATT`, minimum value alarm 0.5°C and maximum value alarm 45°C
90 `temp_sensor 3 2 7d01186838f2ff28 5 450 0 BATT`
92 ## Building a custom firmware with temperature sensor support (F3 only)
94 This needs to be added in the `target.h` file:
97 #define USE_TEMPERATURE_SENSOR
98 #define TEMPERATURE_I2C_BUS BUS_I2Cx // replace x with the index of the I²C bus the temperature sensors will be connected to
100 // for LM75 sensors support
101 #define USE_TEMPERATURE_LM75
103 // for DS18B20 sensors
105 #define USE_1WIRE_DS2482
106 #define USE_TEMPERATURE_DS18B20
109 ## Configuring the way OSD temperature labels are displayed
111 You can use the `osd_temp_label_align` setting to chose how the labels for the temperature sensor's values are displayed. Possible alignment values are `LEFT` and `RIGHT`.